<!doctype html>
        <!--[if lt IE 7]> <html class="lt-ie9 lt-ie8 lt-ie7" lang="en-US"> <![endif]-->
        <!--[if IE 7]>    <html class="lt-ie9 lt-ie8" lang="en-US"> <![endif]-->
        <!--[if IE 8]>    <html class="lt-ie9" lang="en-US"> <![endif]-->
        <!--[if gt IE 8]><!--> <html lang="en-US"> <!--<![endif]-->
        <head>
                <!-- META TAGS -->
                <meta charset="UTF-8" />
                <meta name="viewport" content="width=device-width, initial-scale=1.0">

                <title>Knowledge Base Theme</title>

                <link rel="shortcut icon" href="images/favicon.png" />


                

                <!-- Style Sheet-->
                <link rel="stylesheet" href="style.css"/>
                <link rel='stylesheet' id='bootstrap-css-css'  href='css/bootstrap5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='responsive-css-css'  href='css/responsive5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='pretty-photo-css-css'  href='js/prettyphoto/prettyPhotoaeb9.css?ver=3.1.4' type='text/css' media='all' />
                <link rel='stylesheet' id='main-css-css'  href='css/main5152.css?ver=1.0' type='text/css' media='all' />
                <link rel='stylesheet' id='custom-css-css'  href='css/custom5152.html?ver=1.0' type='text/css' media='all' />
				<link rel='stylesheet' href="css/no-show.css" />
                <!-- HTML5 shim, for IE6-8 support of HTML5 elements -->
                <!--[if lt IE 9]>
                <script src="js/html5.js"></script></script>
                <![endif]-->

        </head>

        <body>
		<div id="app">
		<div class="header-wrapper">

			<div class="container">


				<div >
					<!-- Website Logo -->
					<a href="main.html"   >
						<img src="images/taru.jpg"
							 style="height:60px;">
					</a>
					<span class="tag-line">塔里木大学</span>
				</div>


				<!-- Start of Main Navigation -->
				<nav class="main-nav">
					<div class="menu-top-menu-container">
						<ul id="menu-top-menu" class="clearfix">
							<li class="current-menu-item"><a href="main.html">Home</a></li>
							<li><a href="#">科普模块</a>
								<ul class="sub-menu">
									<li><a @click="pes"  href="disease-list.html">虫害科普</a></li>
									<li><a @click="pesCon" href="disease-list.html">虫害防治</a></li>
									<li><a @click="dis" href="disease-list.html">病害科普</a></li>
									<li><a @click="disCon" href="disease-list.html">病害防治</a></li>
								</ul></li>
							<li><a href="exchange-list.html">讨论模块</a></li>
							<li><a href="forecast.html">数据预测</a></li>
							<li><a href="#">用户信息</a>
								<ul class="sub-menu">
									<li><a href="selectUser.html">查看用户信息</a></li>
									<li><a href="updateUser.html">修改用户信息</a></li>
									<li><a href="updateUserPassword.html">修改用户密码</a></li>
								</ul>
							</li>
							<li v-if="flag"><a href="#">管理员模块</a>
								<ul class="sub-menu">
									<li><a href="disease-list-statue.html">文章审核</a></li>

								</ul>
							</li>

						</ul>
					</div>
				</nav>
				<!-- End of Main Navigation -->

			</div>

		</div>
				<br /><br />
				
				
                <div  style="margin:0 auto; width:400px;  text-align:center;">
                	<table  style="text-align:center;vertical-align:middle; width: 400px; height: 20px; ">
                		
                		<tr>
                			<img class="normal2"></img>
                		</tr>
                		</table>
                	<table  style="text-align:center;vertical-align:middle; width: 400px; height: 100px; ">
									<tr>
										<td style="width: 100px; height: 50px; ">
											<label form="pass3">旧密码： </label>
										</td>
										<td>                                                              
											<input @mouseleave="init" v-model="userPasswordOld" type="password" name="pass1" id="pass1" class="required input-xlarge" value="" >
										</td>
									</tr>
									
									
									<tr>
										<td style="width: 100px; height: 50px; ">
											<label form="pass1">新密码： </label>
										</td>
										<td>                                                              
											<input v-model="userPassword1" type="password" name="pass1" id="pass1" class="required input-xlarge" value="" >
										</td>
									</tr>
									<tr>
										<td style="width: 100px; height: 50px;">
											<label form="pass2">再次输入新密码： </label>
										</td>
										<td>                                                              
											<input v-model="userPassword2" type="password" name="pass2" id="pass2" class="required input-xlarge" value="" >
										</td>
									</tr>
									<tr>
										<td style="width: 100px; height: 50px; ">
											<label form="birth">密保问题1： </label>
										</td>
										<td>    
											<select v-model="userQuestionOne" name="que1" id="que1" style="width: 285px; height: 35px;"	>  
												<option value="您父亲姓名？">您父亲姓名？</option> 
												<option value="您母亲姓名？">您母亲姓名？</option> 
												<option value="您孩子姓名？">您孩子姓名？</option> 
											</select>
										</td>
									</tr>
									<tr>
										<td style="width: 100px; height: 50px; ">
											<label form="ans1">密保答案1： </label>
										</td>
										<td>                                                              
											<input v-model="userAnswerOne" type="text" name="ans1" id="ans1" class="required input-xlarge" value="" >
										</td>
									</tr>
									<tr>
										<td style="width: 100px; height: 50px;">
											<label form="birth">密保问题2： </label>
										</td>
										<td>    
											<select v-model="userQuestionTwo"  name="que2" id="que2" style="width: 285px; height: 35px;">  
												<option value="您小学学校的校名？">您小学学校的名称？</option> 
												<option value="您中学学校的校名？">您中学学校的名称？</option> 
												<option value="您大学学校的校名？">您大学学校的名称？</option>
											</select>
										</td>
									</tr>
									<tr>
										<td style="width: 100px; height: 50px; ">
											<label form="ans2">密保答案2： </label>
										</td>
										<td>                                                              
											<input v-model="userAnswerTwo" type="text" name="ans2" id="ans2" class="required input-xlarge" value="" >
										</td>
									</tr>
									
								</table>
								<table  style="text-align:center;vertical-align:middle; width: 400px; height: 100px; ">
									<tr>
										
										<td  style="width: 300px; height: 50px;">
											<input @click="upd " class="btn" name="submit" type="submit" id="submit"  value="修改" style="width: 150px;">
										</td>
										
									</tr>
								</table>
								
                </div>

		</div>
                <!-- script -->
                 <script type='text/javascript' src='js/jquery-1.8.3.min.js'></script>
                <script type='text/javascript' src='js/jquery.easing.1.34e44.js?ver=1.3'></script>
                <script type='text/javascript' src='js/prettyphoto/jquery.prettyPhotoaeb9.js?ver=3.1.4'></script>
                <script type='text/javascript' src='js/jquery.liveSearchd5f7.js?ver=2.0'></script>
				<script type='text/javascript' src='js/jflickrfeed.js'></script>
                <script type='text/javascript' src='js/jquery.formd471.js?ver=3.18'></script>
                <script type='text/javascript' src='js/jquery.validate.minfc6b.js?ver=1.10.0'></script>
                <script type='text/javascript' src='js/custom5152.js?ver=1.0'></script>
                <script type="text/javascript" src="js/url.js"></script>
				<script type="text/javascript" src="js/vue(1).js"></script>
				<script type="text/javascript" src="js/axios.min.js"></script>
				<script>
					var vue = new Vue({
						el: '#app', //挂载点
						data: {
							userName:'',
							userPassword1:'',
							userPassword2:'',
							userNickname:'',
							userSex:'',
							userDeviceNumber:'',
							userQuestionOne:'',
							userQuestionTwo:'',
							userAnswerOneOld:'',
							userAnswerTwoOld:'',
							userBrithday:'',
							userId:'',
							userPasswordOld:'',
							userAnswerOne:'',
							userAnswerTwo:'',
                            flag:false
						},
						created: function() {
                            this.userOrAdmin();
						},
						methods: {
							//查所有
                            userOrAdmin: function(){
                                var userSort = window.sessionStorage.getItem("userSort");
                                if(userSort == 2 ){
                                    self.flag = true;
                                }
                            },
							upd: function() {
								var self = this;
								self.userId = window.sessionStorage.getItem("userId");
									var param=new URLSearchParams();	
									param.append('userQuestionOne',self.userQuestionOne);
									param.append('userQuestionTwo',self.userQuestionTwo);
									param.append('userAnswerOne',self.userAnswerOneOld);
									param.append('userAnswerTwo',self.userAnswerTwoOld);
									param.append('userPassword',self.userPassword1);
									param.append('userId',self.userId);
									axios
									.post(web_server+"update/user/password",param)
										.then(function(response) {
											//var object =JSON.stringify(response)
											var objects= response.data;
											if(objects.status == 200) {
												var object = objects.data
													self.list= object;
													alert(objects.message);
													window.location.href = "updateUserPassword.html"
													//this.moun;
													//self.list.size=self.commentLenght;
													//console.log(self.list[0].commentList)
											}else if(objects.status == 500){
												alert(objects.message)
											}
										})
									.catch(function(error) {
										alert(error)
										
									});
								
							},
							init: function(){
								var self = this;
								self.userId = window.sessionStorage.getItem("userId");
									var param=new URLSearchParams();	
									param.append('userId',self.userId);
									axios
									.post(web_server+"query/user/id",param)
										.then(function(response) {
											//var object =JSON.stringify(response)
											var objects= response.data;
											if(objects.status == 200) {
												var object = objects.data
												if( self.userPasswordOld == object.userPassword){
													self.list= object;
													console.log(object);
													self.userPasswordOld = object.userPassword;
													self.userQuestionOne = object.userQuestionOne;
													self.userQuestionTwo = object.userQuestionTwo ;
													self.userAnswerOneOld = object.userAnswerOne ;
													self.userAnswerTwoOld = object.userAnswerTwo ;
												}else{
													alert("旧密码不正确")
												}
											}else if(objects.status == 500){
												alert(objects.message)
											}
										})
									.catch(function(error) {
										alert(error)
										
									});
							},
                            pes:function(){
                                window.sessionStorage.setItem("sort", "1");
                            },
                            pesCon:function(){
                                window.sessionStorage.setItem("sort", "2");
                            },
                            dis:function(){
                                window.sessionStorage.setItem("sort", "3");
                            },
                            disCon:function(){
                                window.sessionStorage.setItem("sort", "4");
                            }


                        }
					})
				</script>
        </body>
</html>

